<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:sdu="http://sduept.com/jsf/cc">
<h:head>
	<link href="/css/primefaces/menubase.css" rel="stylesheet"
		type="text/css" />
	<title>变电站多选择器--按运维单位对变电站进行分组</title>
	<style type="text/css">
.value {
	font-weight: bold;
}
.ui-tree {
	width: 600px;
    position: relative;
    height: 500px;
    overflow-y: scroll;
}
</style>
</h:head>
 
	<h:body>
		<h:form id="toolbarForm">
			<p:toolbar id="toolbar">
				<f:facet name="left">
					<h:outputText value="电压等级:" style="margin-right:10px"/>
					<h:selectOneMenu value="#{substationGroupByOpSubstationSelectorController.selectedVol}" style="width:90px;height:31px;">
						<p:ajax event="change" listener="#{substationGroupByOpSubstationSelectorController.changeVoltage}"
							update=":treeForm:stationTree" />
						<f:selectItem itemLabel="全部" itemValue="0" />
						<f:selectItem itemLabel="220kV" itemValue="220" />
						<f:selectItem itemLabel="500kV" itemValue="500" />
						<f:selectItem itemLabel="800kV" itemValue="800" />
					</h:selectOneMenu>
				</f:facet>
				<f:facet name="right">
					<p:commandButton value="确定" ajax="false" style="margin-right:10px;" id="okBtn"
						actionListener="#{substationGroupByOpSubstationSelectorController.onSubstationSelected()}" />
				</f:facet>
			</p:toolbar>
		</h:form>
		<h:form id="treeForm">
			<p:tree id="stationTree" widgetVar="stationTree" dynamic="true" 
				animate="true" var="node" style="border:0"
				value="#{substationGroupByOpSubstationSelectorController.stationRoot}"
				selectionMode="checkbox" selection="#{substationGroupByOpSubstationSelectorController.selectedNodes}" >
				<p:ajax event="expand" update="treeForm:stationTree" listener="#{substationGroupByOpSubstationSelectorController.onNodeExpand}" />
				<p:ajax event="select" listener="#{substationGroupByOpSubstationSelectorController.onStationNodeSelect}" />
				<p:ajax event="unselect" listener="#{substationGroupByOpSubstationSelectorController.onStationNodeUnSelect}" />
				<p:treeNode type="root" icon="fa fa-home">
					<h:outputText value="#{node}" />
				</p:treeNode>
				<p:treeNode type="maintenanceUnit" icon="fa fa-home">
					<h:outputText value="#{node}" />
				</p:treeNode>
				<p:treeNode type="station">
					<h:outputText value="#{node}" />
				</p:treeNode>
			</p:tree>
		</h:form>
	</h:body>
</html>
